Needs refactor
